package com.beerandjesus.sportofkings.handicapper.migration.hibernate;

/**
 * Date: 3/24/15
 * Time: 9:14 PM
 */
public class HibernateConfig {
    private String dialect;
    private String url;
    private String driverClass;
    private String username;
    private String password;

    public String getDialect() {
        return dialect;
    }

    public String getUrl() {
        return url;
    }

    public String getDriverClass() {
        return driverClass;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public HibernateConfig(String dialect, String url, String driverClass, String username, String password) {
        this.dialect = dialect;
        this.url = url;
        this.driverClass = driverClass;
        this.username = username;
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HibernateConfig that = (HibernateConfig) o;

        if (!dialect.equals(that.dialect)) return false;
        if (!driverClass.equals(that.driverClass)) return false;
        if (!password.equals(that.password)) return false;
        if (!url.equals(that.url)) return false;
        if (!username.equals(that.username)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = dialect.hashCode();
        result = 31 * result + url.hashCode();
        result = 31 * result + driverClass.hashCode();
        result = 31 * result + username.hashCode();
        result = 31 * result + password.hashCode();
        return result;
    }
}
